package p270jp.pxv.android.viewholder;

import android.view.View;
import android.view.ViewTreeObserver;

/* renamed from: jp.pxv.android.viewholder.CalcHeightViewHolder */
/* loaded from: classes2.dex */
public class CalcHeightViewHolder extends BaseViewHolder {

    /* renamed from: jp.pxv.android.viewholder.CalcHeightViewHolder$CalcHeightItem */
    /* loaded from: classes2.dex */
    public static class CalcHeightItem {
        public int height = -1;
        private OnCellItemSizeChangeListener onCellItemSizeChangeListener;

        public int getHeight() {
            return this.height;
        }

        public OnCellItemSizeChangeListener getOnCellItemSizeChangeListener() {
            return this.onCellItemSizeChangeListener;
        }

        public void setHeight(int i) {
            this.height = i;
        }

        public void setOnCellItemSizeChangeListener(OnCellItemSizeChangeListener onCellItemSizeChangeListener) {
            this.onCellItemSizeChangeListener = onCellItemSizeChangeListener;
        }
    }

    /* renamed from: jp.pxv.android.viewholder.CalcHeightViewHolder$OnCellItemSizeChangeListener */
    /* loaded from: classes2.dex */
    public interface OnCellItemSizeChangeListener {
        void onChange(int i, int i2);
    }

    public CalcHeightViewHolder(View view) {
        super(view);
    }

    public void postCalcViewHeight(final CalcHeightItem calcHeightItem) {
        this.itemView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { // from class: jp.pxv.android.viewholder.CalcHeightViewHolder.1
            @Override // android.view.ViewTreeObserver.OnGlobalLayoutListener
            public void onGlobalLayout() {
                calcHeightItem.getOnCellItemSizeChangeListener().onChange(CalcHeightViewHolder.this.itemView.getHeight(), CalcHeightViewHolder.this.getAdapterPosition());
                CalcHeightViewHolder.this.itemView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            }
        });
    }
}
